//
//  LeftTableViewCell.m
//  LiangYa_BObject
//
//  Created by dllo on 15/10/28.
//  Copyright © 2015年 YuHao. All rights reserved.
//

#import "LeftTableViewCell.h"

@implementation LeftTableViewCell

- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier
{
    self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
    if (self) {
        
        self.logo = [[UIImageView alloc] init];
        [self.contentView addSubview:_logo];
        
        self.titleL = [[UILabel alloc] init];
        _titleL.textColor = [UIColor whiteColor];
        _titleL.font = [UIFont boldSystemFontOfSize:17];
        [self.contentView addSubview:_titleL];
        
        self.clearB = [UIButton buttonWithType:UIButtonTypeSystem];
        [_clearB setTitle:@"X" forState:UIControlStateNormal];
        [_clearB setTitleColor:[UIColor blackColor] forState:UIControlStateNormal];
        _clearB.layer.cornerRadius = 15;
        _clearB.backgroundColor = [UIColor whiteColor];
        _clearB.hidden = YES;
        [self.contentView addSubview:_clearB];
        
        self.nightS = [[UISwitch alloc] init];
        _nightS.hidden = YES;
        [self.contentView addSubview:_nightS];
        
        
    }
    return self;
}

- (void)layoutSubviews
{
    [super layoutSubviews];
    self.backgroundColor = [UIColor clearColor];
    
    _logo.frame = CGRectMake(5, 10, 25, 25);
    _titleL.frame = CGRectMake(40, 6, 160, 30);
    _clearB.frame = CGRectMake(cellWidth - 35, 6, 30, 30);
    _nightS.frame = CGRectMake(cellWidth - 55, 6, 35, 30);
    
}

- (void)awakeFromNib {
    // Initialization code
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

@end
